﻿@model App.Models.Sys.SysUserModel
@using App.Common;
@using App.Models.Sys;
@using App.Admin;
@{
    ViewBag.Title = "创建";
    Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
    List<permModel> perm = (List<permModel>)ViewBag.Perm;
    if (perm == null)
    {
        perm = new List<permModel>();
    }
}

<script type="text/javascript">
    $(function () {
        $("#btnSave").click(function () {
            if ($("form").valid()) {
                $.ajax({
                    url: "@Url.Action("Create")",
                    type: "Post",
                    data: $("form").serialize(),
                    dataType: "json",
                    success: function (data) {
                        if (data.type == 1) {
                            window.parent.frameReturnByMes(data.message);
                            window.parent.frameReturnByReload(true);
                            window.parent.frameReturnByClose();
                        }
                        else {
                            window.parent.frameReturnByMes(data.message);
                        }
                    }
                });
            }
            return false;
        });
        $("#btnReturn").click(function () {
            window.parent.frameReturnByClose();
        });
    });
</script>
<div class="mvctool bgb">
    @Html.ToolButton("btnSave", "icon-save", "保存", perm, "Save", true)
    @Html.ToolButton("btnReturn", "icon-return", "返回", false)
</div>
@using (Html.BeginForm())
{
    @Html.HiddenFor(model => model.Id)
    <input id="CreateTime" type="hidden" name="CreateTime" value="2000-1-1" />
    <table class="fromEditTable setTextWidth300">
        <tbody>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.UserName)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.UserName)
                </td>
                <td>@Html.ValidationMessageFor(model => model.UserName)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Password)：
                </td>
                <td style="width: 310px">
                   @* @Html.EditorFor(model => model.Password)*@
                    @Html.PasswordFor(model => model.Password)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Password)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Password2)：
                </td>
                <td style="width: 310px">
                    @* @Html.EditorFor(model => model.Password2)*@
                     @Html.PasswordFor(model => model.Password2)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Password2)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.TrueName)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.TrueName)
                    
                </td>
                <td>@Html.ValidationMessageFor(model => model.TrueName)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Card)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.Card)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Card)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.MobileNumber)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.MobileNumber)
                </td>
                <td>@Html.ValidationMessageFor(model => model.MobileNumber)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.PhoneNumber)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.PhoneNumber)
                </td>
                <td>@Html.ValidationMessageFor(model => model.PhoneNumber)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.QQ)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.QQ)
                </td>
                <td>@Html.ValidationMessageFor(model => model.QQ)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.EmailAddress)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.EmailAddress)
                </td>
                <td>@Html.ValidationMessageFor(model => model.EmailAddress)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.OtherContact)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.OtherContact)
                </td>
                <td>@Html.ValidationMessageFor(model => model.OtherContact)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Province)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.Province)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Province)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.City)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.City)
                </td>
                <td>@Html.ValidationMessageFor(model => model.City)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Village)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.Village)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Village)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Address)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.Address)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Address)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.State)：
                </td>
                <td style="width: 310px">
                    @Html.CheckBoxFor(model => model.State, new { @checked = true })
                </td>
                <td>@Html.ValidationMessageFor(model => model.State)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.CreatePerson)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.CreatePerson)
                </td>
                <td>@Html.ValidationMessageFor(model => model.CreatePerson)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Sex)：
                </td>
                <td style="width: 310px">
                    @*@Html.EditorFor(model => model.Sex)*@
                   
                    @Html.DropDownListFor(model => model.Sex,  new SelectList(new []{"男","女"}))
                    @Html.DropDownListFor(model => model.Sex, ViewData["sex"] as SelectList)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Sex)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Birthday)：
                </td>
                <td style="width: 310px">
                   
                    @Html.TextBoxFor(model=>model.Birthday,new
                    {
                        @class="easyui-datebox",
                        id="txtBirthday"
                        
                    
                    })
                    @*@Html.EditorFor(model => model.Birthday)*@
                </td>
                <td>@Html.ValidationMessageFor(model => model.Birthday)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.JoinDate)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.JoinDate)
                </td>
                <td>@Html.ValidationMessageFor(model => model.JoinDate)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Marital)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.Marital)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Marital)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Political)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.Political)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Political)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Nationality)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.Nationality)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Nationality)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Native)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.Native)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Native)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.School)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.School)
                </td>
                <td>@Html.ValidationMessageFor(model => model.School)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Professional)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.Professional)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Professional)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Degree)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.Degree)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Degree)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.DepId)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.DepId)
                </td>
                <td>@Html.ValidationMessageFor(model => model.DepId)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.PosId)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.PosId)
                </td>
                <td>@Html.ValidationMessageFor(model => model.PosId)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Expertise)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.Expertise)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Expertise)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.JobState)：
                </td>
                <td style="width: 310px">
                    @Html.EditorFor(model => model.JobState)
                </td>
                <td>@Html.ValidationMessageFor(model => model.JobState)</td>
            </tr>
            <tr>
                <td style="width: 100px; text-align: right;">
                    @Html.LabelFor(model => model.Photo)：
                </td>
                <td style="width: 310px">
                    @Html.HiddenFor(model => model.Photo)
                    <img class="expic" src="/Content/Images/NotPic.jpg" /><br />
                    <a href="javascript:$('#FileUpload').trigger('click');" class="files"></a>
                    <input type="file" class="displaynone" size="10" value="" id="FileUpload" name="FileUpload" onchange="Upload('SingleFile', 'Photo', 'FileUpload','1','1');" />
                    <span class="uploading">请稍候...</span>
                </td>
                <td>@Html.ValidationMessageFor(model => model.Photo)</td>
            </tr>

        </tbody>
    </table>
}
